package com.class05.proxy;

import com.class05.service.Calculator;


// 静态代理类
public class CalculatorStaticProxy implements Calculator {
//    核心业务逻辑
    private Calculator calculator;

    public CalculatorStaticProxy(Calculator calculator) {
        this.calculator = calculator;
    }

    @Override
    public int add(int i, int j) {
        System.out.println("日志，方法 add()，参数是：" + i + "," + j);
        int add = calculator.add(i, j);
        System.out.println("日志，方法 add()，结果是：" + add);

        return add;

    }

    @Override
    public int sub(int i, int j) {
        return 0;
    }

    @Override
    public int mul(int i, int j) {
        return 0;
    }

    @Override
    public int div(int i, int j) {
        return 0;
    }
}
